import React from 'react';
import ReactDOM from 'react-dom';


class ComponentLifeCycle extends React.Component{

	componentWillMount(){
		console.log('componentWillMount');
	}
	componentDidMount(){
		console.log('componentDidMount');
	}
	constructor(props){
		super(props);
		console.log('constructor');
		this.state={ status: true};
		this.toggleState = this.toggleState.bind(this);

	}
	render() {
		console.log('render');
		return <h1 onClick={this.toggleState}>
		{this.state.status.toString()}
		</h1>
		}
	componentWillReceiveProps(nextprops){
		console.log('componentWillReceiveProps');
	}
	shouldComponentUpdate(nextProps,nextStates){
		console.log('shouldComponentUpdate');
		return true;
	}
	componentWillUpdate(){
		console.log('componentWillUpdate');
	}
	componentWillUnmount(){
		console.log('componentWillUnmount');
	}

	toggleState() {
		this.setState({status: !this.state.status})
	}

}
export default ComponentLifeCycle 


